package javaAPI.StringPractice;

import java.util.Random;
import java.util.Scanner;

public class StringPractice3 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个字符数组");
        String str=sc.next();
        String result=rotate(str);
        System.out.println(result);
    }
    public static String rotate(String str){
        char[] arr=str.toCharArray();
        Random r=new Random();
        for (int i = 0; i < arr.length; i++) {
            int index=r.nextInt(arr.length);
            char temp=0;
            temp=arr[index];
            arr[index]=arr[i];
            arr[i]=temp;
        }
        str=new String(arr);
        return str;
    }
}
